-
Notifications
You must be signed in to change notification settings - Fork 0
Topology suppression #95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds “topology suppression” to the clustering pipeline to zero-out pixels that don’t match an expected neighborhood pattern, aiming to improve cluster quality before reconstruction.
Changes:
- Introduces
ClusteringBase.topology_suppress()to suppress pixels that don’t match the expected neighbor topology and re-sort outputs. - Integrates topology suppression into
ClusteringNN.run()prior to trimming zero-suppressed pixels.
Comments suppressed due to low confidence (1)
src/hexsample/clustering.py:331
- After
topology_suppress,pha,col, androwhave already been sliced/reordered to match the selected pixels. Reusingmask(which still contains indices into the original 7-pixel arrays) to indexcol/row/phawill produce incorrect selections and can raise IndexError whenmaskcontains values >len(col)-1. Use a boolean keep mask derived from the post-suppression arrays (e.g.,keep = pha > 0) and apply it directly topha/col/row, or resetmasktonp.arange(len(pha))[pha > 0]before indexing.
mask = mask[pha > 0]
# Trim the relevant arrays.
col = col[mask]
row = row[mask]
pha = pha[mask]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.